<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<html>

<head>
    <title>Title</title>
    <script src="<%= request.getContextPath()%>/jquery/jquery-3.2.0.min.js"></script>
    <script type="text/javascript">
        function btn() {
            var xmlrequst = $.post("<%= request.getContextPath()%>/jquerystudy", {"id": "1","name":"ganhx"}, function (data, textStatus) {
                alert(data);
                var obj = eval ("(" + data + ")");//一定要先转化成json能解析的格式
                alert(obj[2].id+":"+obj[2].name);
                for(var x=0; x < obj.length; x++) {
                    alert(obj[x].id+":"+obj[x].name);
                }

            });
        }
    </script>
</head>
<body>
<input type="button" name="btn" value="弹出信息" id="btn" onclick="btn()">
</body>
</html>
